1 <?php
2 include(
"header.php");
3 include(
"sidebar.php");
4
5 include(
"dbconnection.php");
6 if
(isset($_GET['testid']))
7 {
8 $results = mysql_query(
"DELETE from testdrive where bookingid ='$_GET[testid]'");
9 }

10
11 if
(isset($_GET['testbid']))
12 {
13 $results = mysql_query(
"UPDATE testdrive SET status='Approved' where bookingid ='$_GET[testbid]'");
14 }

15
16 if
(isset($_GET['testbida']))
17 {
18 $results = mysql_query(
"UPDATE testdrive SET status='Rejected' where bookingid ='$_GET[testbida]'");
19 }

20 if
(isset($_GET["testbidab"]))
21 {
22     echo
"test";
23 $results = mysql_query(
"UPDATE testdrive SET status='Completed' where bookingid ='$_GET[testbidab]'");
24 }
25
26
27 $result= mysql_query(
"select * from testdrive");
28 ?>
29         
30                             
31         <div id=
"main">
32             
33             <a name=
"TemplateInfo"></a>
34             <h1>Test drive</h1>
35           
36         <form id=
"form1" name="form1" method="post" action="">
37           <table width=
"672" border="1">
38             <tr>
39               <th width=
"76" scope="col">Booking <br /> ID</th>
40               
41               <th width=
"123" scope="col">Vehicle details</th>
42               <th width=
"128" scope="col">Customer details</th>
43               <th width=
"108" scope="col">Booking <br /> Date / Time</th>
44               <th width=
"71" scope="col">Comments</th>
45                 <th width=
"70" scope="col">Status</th>
46               
47               <th width=
"64" scope="col">Action</th>
48            
49             </tr>
50              <?php
51           
while($arrrec= mysql_fetch_array($result))
52           {
53           
54 $result1= mysql_query(
"select * from vehiclestore where vehicleid='$arrrec[vehicleid]'");
55 $arrrec1= mysql_fetch_array($result1);
56
57 $result2= mysql_query(
"select * from customer where custid='$arrrec[custid]'");
58 $arrrec2= mysql_fetch_array($result2);
59
60
61             echo
"<tr>
62               <td>$arrrec[bookingid]</td>
63               <td>
64
65               <b>Vehicle ID:</b> $arrrec1[vehicleid]<br>
66               <b>Vehicle Name:</b> $arrrec1[vehname]<br>
67               <b>Vehicle Model:</b> $arrrec1[model]<br>
68               </td>
69               <td>
70               <b>Customer ID: </b>$arrrec2[custid]<br>
71               <b>Name: </b>$arrrec2[fname] $arrrec2[lname]<br>
72               <b>Contact No.: </b><br>$arrrec2[contactno1]<br>
73               </td>
74               <td><strong>Date:</strong> $arrrec[date] <br>
75               <strong>Time:</strong> $arrrec[time]</td>
76                <td>$arrrec[comments]</td>"
;
77            
78             echo
"<td><b>$arrrec[status]</b><br>";
79             
80     
if(isset($_SESSION[empid]))
81 {
82         
if($arrrec[status] != "Completed")
83         {
84                     echo
"<a href='viewtestdrive.php?testbid=$arrrec[bookingid]'>Accept</a><br>";
85                     echo
"<a href='viewtestdrive.php?testbida=$arrrec[bookingid]'>Reject</a><br>";
86                 echo
"<a href='viewtestdrive.php?testbidab=$arrrec[bookingid]'>Completed</a></td>";
87         }
88 }
89               echo
"</td><td>";
90              
if($arrrec[status] != "Completed")
91              {
92               echo
" <a href='testdrive.php?testid=$arrrec[bookingid]'>Edit</a> |
93               <a href='viewtestdrive.php?testid=$arrrec[bookingid]'>Delete</a>"
;
94              }
95               echo
"</td></tr>";
96             }
97          ?>
98           </table>
99         </form>
100
101           <p>&nbsp;</p>
102 <br />
103                                             
104         </div>
105         
106 <!-- wrap ends here -->
107 </div>
108         
109 <?php
110 include(
"footer.php");
111 ?>


Gõ tìm kiếm nhanh...